/*
 * @Author: Wangjun
 * @Date: 2023-08-14 10:40:47
 * @LastEditTime: 2023-09-06 09:19:05
 * @LastEditors: Wangjun
 * @Description: 无实际意义，需要用正常算子替换
 * @FilePath: \nodex\nodeio\op_ao.go
 * hnxr
 */
package nodeio

import (
	"gitee.com/hnxr_1/nodex"
)

//0:> 1>= 2 < 3:<= 4== 5 !=
//M

func init() {
	nodex.Reister(new(AO))
}

type AO struct {
	nodex.Node
	Y nodex.Double `remark:"输入值"`
}

func (m *AO) Init(mem *nodex.Memory) (err error) {
	outs := make([]*nodex.Out, 1)
	outs[0] = &nodex.Out{Name: "Y", Value: m.Y.DoubleValue}
	m.SetOuts(outs)
	return
}
func (m *AO) GetModelID() int {
	return nodex.ModOut
}

func (m *AO) GetName() string {
	return "AO"
}

func (m *AO) GetResult() (v float64, isBad bool) {
	return m.Y.Value, m.Bad
}

/**
 * @description: 节点信息
 * @return {*}
 */
func (m *AO) RegData() []byte {
	return nodex.MakeRegData(m, "模拟量输出", m.GetName(), "")
}

func (m *AO) Calc() (err error) {
	m.Bad = false
	return
}
